configs = function() {
	return {
		panel : function() {
			
			var store = new Store({
				fields: ['id', 'name', 'keyName', 'value', 'grouped'],
				groupField: 'grouped',
				proxy: {
			        type: 'ajax',
			        url: '../admin/config.jspx?index'
			    },
			    autoLoad: true
			});
			
			var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
	        	  clicksToMoveEditor: 1,
	              autoCancel: false,
	        	  listeners: {
	        		  edit: function(fn, e, eOpts) {
	        			  var res = RequestByUrl('../admin/config.jspx?indexOFedit', {
	        					id: e.newValues.id,
	        					value: e.newValues.value
	        			   });
	        			  if (res.success) {
	        				 Ext.Show.msg(res.msg, '');  
	        			  }
	        		  }
	        	  }
	        });
			
			var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
		        groupHeaderTpl: '{name} ({rows.length})'
		    });
			
			var grid = new Grid({
				title: '系统参数',
				region: 'center',
				store: store,
				minColumnWidth: 35,
				stripeRows: true,
				plugins: [rowEditing],
				features: [groupingFeature],
				columns: [
		             new Ext.grid.RowNumberer(),
		             {header: '序号', dataIndex: 'id', hidden: true},
		             {header: '参数名称', dataIndex: 'name', width: 180},
		             {header: '参数属性', dataIndex: 'keyName', width: 180},
		             {header: '参数值', dataIndex: 'value', flex: 1, field: {
		                 xtype: 'textfield'
		             }}
				]
			});
			
			var panel = new Panel({
				layout: 'border',
				items: [grid]
			});
			
			return panel;
		}
	};
}();